<template>
	<!-- 派工单信息 -->
	<view class="">
		<view class="w-100% pl-48rpx pr-48rpx pb-16rpx text pt-12rpx" v-for="(item, index) in proTaskList" :key="index">
			<view class="w-100% textPadding">
				派工单号：{{ item.prodWork }}
			</view>
<!-- 			<view class="w-50% textPadding">
				卷盘号：{{ item.reelNumber }}
			</view> -->
			<view class="flex-wrap-between">
				<view class="w-342rpx textPadding">
					物料编码：{{ item.mateCode }}
				</view>
				<view class="w-287rpx textPadding">
					工序描述：{{ item.processDesc }}
				</view>
				<view class="w-342rpx textPadding" v-if="!ultimate">
					作业设备：{{ item.workDevice }}
				</view>
				<view class="w-287rpx textPadding" v-if="!ultimate">
					操作工：{{ item.operatorName }}
				</view>
				<view class="w-342rpx textPadding" v-if="isReelNumber">
					卷盘号：{{ item.reelNumber }}
				</view>
			</view>
			<view class="w-100% textPadding">
				物料描述：{{ item.mateDesc }}
			</view>
		</view>
		<view class="" v-if="reportList?.length">
			<view class="w-100% h-16rpx" style="background-color: #EEEEEE;" v-if="reportList?.length"></view>
			<subtitle titleText="报工信息" v-if="reportList?.length"></subtitle>
			<view class="" style="margin: 24rpx 32rpx;" v-if="reportList?.length">
				<u-table>
					<u-tr class="u-tr">
						<u-th class="u-th" width="22%">
							操作工
						</u-th>
						<u-th class="u-th" width="28%">
							作业设备
						</u-th>
						<u-th class="u-th" width="23%">
							卷盘号
						</u-th>
						<u-th v-if="reportWork" class="u-th" width="27%">
							报工数量(卷)
						</u-th>
						<u-th v-else class="u-th" width="27%">
							报工数量(米)
						</u-th>
					</u-tr>
					<u-tr class="u-tr" v-for="(item, index) in reportList" :key="index">
						<u-td class="u-td abc" width="22%">
							{{ item.operateName }}
						</u-td>
						<u-td class="u-td abc" width="28%">
							{{ item.workDevice }}
						</u-td>
						<u-td class="u-td abc" width="23%">
							{{ item.reelNumber }}
						</u-td>
						<u-td v-if="reportWork" class="u-td abc left" width="27%">
							{{ item.volumesNum }}
						</u-td>
						<u-td v-else class="u-td abc left" width="27%">
							{{ item.reportNum }}
						</u-td>
					</u-tr>
				</u-table>
			</view>
		</view>
	</view>
</template>

<script setup lang="ts">
	import { defineProps, toRefs } from 'vue'
	import subtitle from '@/components/subtitle.vue'
	const props = defineProps<{
		proTaskList ?: {}[];
		reportList ?: {}[];
		ultimate ?: boolean;
		reportWork?: boolean,
		isReelNumber?: boolean,
	}>()
	const proTaskList = toRefs(props).proTaskList
	const reportList = toRefs(props).reportList
</script>

<style scoped>
	.text {
		font-size: 24rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #4B4D55;
		box-shadow: 0rpx 1rpx 0rpx 0rpx #EEEEEE;
	}

	.textPadding {
		padding: 12rpx 0rpx;
	}
	.abc {
		padding: 15rpx 12rpx !important;
	}
	.left{
		text-align: right !important;
	}
</style>